#include <my_header.h>

/* Usage: ./3_read_jam shared.pipe */
int main(int argc, char *argv[]){                                  
    ARGS_CHECK(argc, 2);
    int fd_read = open(argv[1], O_RDONLY);
    ERROR_CHECK(fd_read, -1, "open read");

    sleep(10);  // 读之前停止10s
    char buf[4096] = { 0 };
    while(1)
    {
        read(fd_read, buf, sizeof(buf));
        printf("read \n");
        sleep(2);   // 下一次读之前停止2s
    }

    close(fd_read);
    return 0;
}


